<%-- 
    Document   : kelolaakun
    Created on : Jan 18, 2014, 3:26:36 PM
    Author     : hasbiseptiansyah
--%>
<%@page import="java.util.List"%>
<%@include file="../template/header.jsp"%>
<% 
    UserBean sesiUser = (UserBean) session.getAttribute("sesiUser"); 
    
%>
<div class="row">
    <div class="col-lg-6 col-lg-push-1">
        <h3>${title}</h3>
        <hr>
        <a href="buat_akun" class="btn btn-success"><i class="glyphicon glyphicon-plus"></i> Buat Akun Baru</a>
        <table class="table">
            <thead>
            <th>ID</th>
            <th>Nama Depan</th>
            <th>Nama Belakang</th>
            <th>Email Akun</th>
            <th >Role</th>
            <th class="text-center" colspan="2">Action</th>
            </thead>
            <tbody>
                <%
                    List listUser = (List) request.getAttribute("listUser");
                    UserBean dataUser;
                    for (int i = 0; i < listUser.size(); i++) {
                        dataUser = (UserBean) listUser.get(i);
                %>
                <tr>
                    <td><% out.print(dataUser.getIdUser());%></td>
                    <td><%=dataUser.getFirstName()%></td>
                    <td><%=dataUser.getLastName()%></td>
                    <td><%=dataUser.getEmail()%></td>
                    <td><%=dataUser.getnRole()%></td>
                    <td><a href="<%if (dataUser.getIdUser() != sesiUser.getIdUser()) {%>edit_akun?id=<%=dataUser.getIdUser()%><%}%>" class="btn btn-primary" ><i class="glyphicon glyphicon-edit"></i> Edit</a></td>
                    <td>
                        <form action="deleteakun" method="POST">
                            <input type="hidden" name="id" value="<%=dataUser.getIdUser()%>">
                            <input type="submit" class="btn btn-danger" value="Hapus"><!-- i class="glyphicon glyphicon-trash"></i> Hapus</ -->
                        </form>
                    </td>
                </tr>
                <% }%>
            </tbody>
        </table>
    </div>

</div>
<%@include file="../template/footer.jsp"%>
